<?php
namespace app\shop\model;
use app\BaseModel;
use think\facade\Db;



class IndexSellingCash extends BaseModel
{
    //定义表名
    protected $name = 'longbing_card_selling_cash_water';

    protected static function init()
    {
        //TODO:初始化内容
    }


    /**
     * @param $dis
     * @return array
     * @throws \think\exception\DbException
     * 提现记录
     */
    public function cashList($dis){
        $data = $this->where($dis)->order('id desc')->paginate(10)->toArray();
        $data['data'] = lbHandelRadarDate($data['data']);
        return $data;
    }


    /**
     * @param $dis
     * @return float
     * 体现金额
     */
    public function totalCash($dis){
        $data = $this->where($dis)->sum('money');
        return $data;
    }


    /**
     * User: chenniang
     * Date: 2019-09-10 16:47
     * @param $data
     * @return void
     * descption:添加提现记录
     */
    public function cashAdd($data){
        $data['create_time'] = time();
        $data['update_time'] = time();
        $res = $this->insert($data);
        response( $res);
    }



}